import Vue from "vue";
import App from "./App.vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
import Login from "./views/HmLogin.vue";
import Register from "./views/HmRegister.vue";
import Detail from "./views/HmDetail.vue";
import Layout from "./views/HmLayout.vue";
import Article from "./views/HmArticle.vue";
import Collect from "./views/HmCollect.vue";
import Like from "./views/HmLike.vue";
import My from "./views/HmMy.vue";
import Vant from "vant";
import "vant/lib/index.css";
// 把vant中所有的组件都导入了
import { Tabbar, TabbarItem } from "vant";
import { Form } from "vant";
import { Field } from "vant";
Vue.use(Form);
Vue.use(Field);

Vue.use(Tabbar);
Vue.use(TabbarItem);

Vue.use(Vant);
const router = new VueRouter({
  routes: [
    { path: "/", redirect: "/login" },
    { path: "/login", component: Login },
    { path: "/register", component: Register },
    { path: "/detail", component: Detail },
    {
      path: "/layout",
      component: Layout,
      children: [
        { path: "/layout/article", component: Article },
        { path: "/layout/collect", component: Collect },
        { path: "/layout/like", component: Like },
        { path: "/layout/my", component: My },
      ],
    },
  ],
  linkActiveClass: "active",
  linkExactActiveClass: "ex-active",
});
Vue.config.productionTip = false;

new Vue({
  render: (h) => h(App),
  router: router,
}).$mount("#app");
